<#assign contextPath=springMacroRequestContext.getContextPath() />
<#import "/public/frame/main.html" as frame />
<@frame.head "南航明珠商城-畅销商品管理">
</@frame.head>
<div class="page-container" style="overflow:auto;height: 420px;">
			<form action="/productQuestions/replyQuestions" 
				method="post" id="productformlist" 
				name="productformlist">
				
				<table  width="100%" border="0" cellspacing="1">
				<input type="hidden" value="${productQuestions.id}" name="QuestionId" id="QuestionId" />
					<tr style="width: 100%">
						<td >
							咨询人卡号：${productQuestions.memberNo}
						</td>
						<td >
							商品编号：${productQuestions.product.id}
						</td>
					</tr>
					<tr style="width: 500px">
						<td >
							咨询人姓名：${productQuestions.askName}
						</td>
						<td >
							商品名称：${productQuestions.product.baseInfo.name}
						</td>
					</tr>
					<tr style="width: 500px">
						<td >
							咨询时间：${(productQuestions.askDate?string("yyyy-MM-dd HH:mm:ss"))!}
						</td>
						<td >
							咨询类型：${productQuestions.classifiedConsultation.name}
						</td>
					</tr>
					<tr style="width: 500px">
						<td colspan="2">
							咨询内容：${productQuestions.question}
						</td>
						<td >
							
						</td>
					</tr>
					<tr>
					<td  colspan="2">
					<font color="red">*</font>回复内容：<textarea style="width: 540px;height: 150px;" id="answer" name="answer">${productQuestions.answer}</textarea>
					</td>
					</tr>
					<tr>
					<td  colspan="2">
					<input type="checkbox" name="checkedNoAnswer" value="1"/> 无需回复，标记为已处理
					</td>
					</tr>
					
					<tr>
					<td colspan="2">
					<input type="button" class="btn btn-success radius" value="提交回复" style="float: right;" onclick="buSubmit()"/>
					</td>
					</tr>
				</table>
			</form>
	</div>
<@frame.end "default">
</@frame.end>
<script type="text/javascript" src="${contextPath}/resources/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="${contextPath}/resources/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="${contextPath}/resources/js/laypage/laypage.js"></script>

		<script type="text/javascript">

		var path="${contextPath}";

		//提交
		function buSubmit(){
				var QuestionId=$("#QuestionId").val();
				var check=$("input[name='checkedNoAnswer']:checked").val();
				var answer=$("#answer").val();
				
				var checkedNoAnswer;
				if(check){
					checkedNoAnswer=1;
				}else{
					checkedNoAnswer=0;
					if(trim(answer)==""){
						alert("请输入回复内容");
						return;
					}
				}

				$.ajax({
				     url:path+"/productQuestions/replyQuestions",
				     type:"post",
				     data:{"QuestionId":QuestionId,"checkedNoAnswer":checkedNoAnswer,"answer":answer},
				     dataType:"text",
				     beforeSend:function(){},
				     error:function(XMLHttpRequest,textStatus,errorThrown){
				    	 parent.window.location.href = parent.window.location.href;
				     },
				     success:function(msg){
				    
						    layer.msg('回复成功!',{icon:1,time:1000},function(){
						    	parent.window.location.href = parent.window.location.href;

						    });

				     	
				      }
				     });
				
				
			
			
		}
		//js去掉空格
		function trim(str){
			 return  str.replace(/^\s+|\s+$/g,"");
		}
			
		</script>




